package buildings.iterators;

import buildings.dwelling.Dwelling;
import buildings.Floor;
import java.util.Iterator;

public class DwellingIterator implements Iterator {
    
    private Dwelling dwelling;
    private int count;

    public DwellingIterator(Dwelling  d) {
        dwelling = d;
        count = 0;
    }

    public Floor next() {
        return dwelling.getFloorByNumber(count++); //!!!!!!!
    }

    public boolean hasNext() {
        return dwelling.getFloorCount() < count;
    }

    public void remove() throws UnsupportedOperationException {
        throw new UnsupportedOperationException();
    }
}
